package org.输入输出练习;

import java.util.Scanner;

/**
 * @Auther: qingle
 * @Date: 2024/8/19-2:56
 * @Description:
 * 给定一个n 行  m 列的二维正整数数组  a ，第i 行第  j 列元素的值为
 * ai,j 。请你求出数组元素之和。
 *
 * @version: 1.0
 */
public class PIO8_单组_二维数组 {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
//		int[][] a = new int[n][m];
//		long sum = 0L;
//		for (int i = 0; i < n; i++) {
//			for (int j = 0; j < m; j++) {
//				a[i][j] = scanner.nextInt();
//				sum += a[i][j];
//			}
//		}

		long sum = 0;
		for(int i = 0; i < n; i++){
			for(int j = 0; j < m; j++){
				int a = scanner.nextInt();
				sum += a;
			}
		}
		System.out.println(sum);

	}
}
